<div class="content-section introduction">
    <div>
        <span class="feature-title">Menubar</span>
        <span>Menubar is an horizontal menu components with support for nested submenus.</span>
    </div>
</div>

<div class="content-section implementation">
    <p-menubar [model]="items">
        <input type="text" pInputText placeholder="Search">
        <button pButton label="Logout" icon="fa-sign-out"></button>
    </p-menubar>
</div>

<div class="content-section documentation">
    <p-tabView effect="fade">
        <p-tabPanel header="Documentation">
            <h3>Import</h3>
<pre>
<code class="language-typescript" pCode ngNonBindable>
import &#123;MenubarModule,MenuItem&#125; from 'primeng/primeng';
</code>
</pre>

            <h3>MenuModel API</h3>
            <p>Menubar uses the common menumodel api to define its items, visit <a [routerLink]="['/menumodel']">MenuModel API</a> for details.</p>

            <h3>Getting Started</h3>
            <p>Menubar requires nested menuitems as its model.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-menubar [model]="items"&gt;&lt;/p-menubar&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode ngNonBindable>
export class MenubarDemo &#123;

    items: MenuItem[];

    ngOnInit() &#123;
        this.items = [
            &#123;
                label: 'File',
                items: [&#123;
                        label: 'New', 
                        icon: 'fa-plus',
                        items: [
                            &#123;label: 'Project'&#125;,
                            &#123;label: 'Other'&#125;,
                        ]
                    &#125;,
                    &#123;label: 'Open'&#125;,
                    &#123;label: 'Quit'&#125;
                ]
            &#125;,
            &#123;
                label: 'Edit',
                icon: 'fa-edit',
                items: [
                    &#123;label: 'Undo', icon: 'fa-mail-forward'&#125;,
                    &#123;label: 'Redo', icon: 'fa-mail-reply'&#125;
                ]
            &#125;
        ];
    &#125;
&#125;
</code>
</pre>

<h3>Custom Content</h3>
<p>Custom content can be placed between p-menubar tags.</p>

<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-menubar [model]="items"&gt;
    &lt;input type="text" pInputText placeholder="Search"&gt;
    &lt;button pButton label="Logout" icon="fa-sign-out"&gt;&lt;/button&gt;
&lt;/p-menubar&gt;
</code>
</pre>

            <h3>Properties</h3>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>model</td>
                            <td>array</td>
                            <td>null</td>
                            <td>An array of menuitems.</td>
                        </tr>
                        <tr>
                            <td>style</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Inline style of the component.</td>
                        </tr>
                        <tr>
                            <td>styleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the component.</td>
                        </tr>
                    </tbody>
                </table>
            </div>
            
            <h3>Styling</h3>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                    <tr>
                        <th>Name</th>
                        <th>Element</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>ui-menubar</td>
                        <td>Container element.</td>
                    </tr>
                    <tr>
                        <td>ui-menu-list</td>
                        <td>List element.</td>
                    </tr>
                    <tr>
                        <td>ui-menuitem</td>
                        <td>Menuitem element.</td>
                    </tr>
                    <tr>
                        <td>ui-menuitem-text</td>
                        <td>Label of a menuitem.</td>
                    </tr>
                    <tr>
                        <td>ui-menuitem-icon</td>
                        <td>Icon of a menuitem.</td>
                    </tr>
                    <tr>
                        <td>ui-submenu-icon</td>
                        <td>Arrow icon of a submenu.</td>
                    </tr>
                    </tbody>
                </table>
            </div>

            <h3>Dependencies</h3>
            <p>None.</p>
        </p-tabPanel>

        <p-tabPanel header="Source">
            <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/menubar" class="btn-viewsource" target="_blank">
                <i class="fa fa-github"></i>
                <span>View on GitHub</span>
            </a>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-menubar [model]="items"&gt;
    &lt;input type="text" pInputText placeholder="Search"&gt;
    &lt;button pButton label="Logout" icon="fa-sign-out"&gt;&lt;/button&gt;
&lt;/p-menubar&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode ngNonBindable>
export class MenubarDemo &#123;

    items: MenuItem[];

    ngOnInit() &#123;
        this.items = [
            &#123;
                label: 'File',
                icon: 'fa-file-o',
                items: [&#123;
                        label: 'New', 
                        icon: 'fa-plus',
                        items: [
                            &#123;label: 'Project'&#125;,
                            &#123;label: 'Other'&#125;,
                        ]
                    &#125;,
                    &#123;label: 'Open'&#125;,
                    &#123;separator: true&#125;,
                    &#123;label: 'Quit'&#125;
                ]
            &#125;,
            &#123;
                label: 'Edit',
                icon: 'fa-edit',
                items: [
                    &#123;label: 'Undo', icon: 'fa-mail-forward'&#125;,
                    &#123;label: 'Redo', icon: 'fa-mail-reply'&#125;
                ]
            &#125;,
            &#123;
                label: 'Help',
                icon: 'fa-question',
                items: [
                    &#123;
                        label: 'Contents'
                    &#125;,
                    &#123;
                        label: 'Search', 
                        icon: 'fa-search', 
                        items: [
                            &#123;
                                label: 'Text', 
                                items: [
                                    &#123;
                                        label: 'Workspace'
                                    &#125;
                                ]
                            &#125;,
                            &#123;
                                label: 'File'
                            &#125;
                    ]&#125;
                ]
            &#125;,
            &#123;
                label: 'Actions',
                icon: 'fa-gear',
                items: [
                    &#123;
                        label: 'Edit',
                        icon: 'fa-refresh',
                        items: [
                            &#123;label: 'Save', icon: 'fa-save'&#125;,
                            &#123;label: 'Update', icon: 'fa-save'&#125;,
                        ]
                    &#125;,
                    &#123;
                        label: 'Other',
                        icon: 'fa-phone',
                        items: [
                            &#123;label: 'Delete', icon: 'fa-minus'&#125;
                        ]
                    &#125;
                ]
            &#125;,
            &#123;
                label: 'Quit', icon: 'fa-minus'
            &#125;
        ];
    &#125;
&#125;
</code>
</pre>
        </p-tabPanel>
    </p-tabView>
</div>